package com.scbo.utility;

public class CalculateTime {
	public static int convertToSecond(long milisecond) {
		int result = 0;
		result = (int) ((milisecond / 1000) % 60);
		return result;
	}

	public static int convertToMinute(long milisecond) {
		int result = 0;
		result = (int) ((milisecond / (1000 * 60)) % 60);
		return result;
	}

	public static long convertToMilisecond(String minute, String second) {
		long result = 0;
		long minuteValue;
		long secondValue;
		try {
			minuteValue = Long.parseLong(minute);
			secondValue = Long.parseLong(second);
		} catch (Exception e) {
			minuteValue = 0;
			secondValue = 0;
			e.printStackTrace();
		}
		result = (secondValue * 1000) + (minuteValue * 60 * 1000);
		return result;
	}

}
